/**
 * 
 */
package com.idea.auction.service;

import com.idea.auction.model.Live;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.server.BaseService;

/**
 * @author y.z
 */
public class LiveService extends BaseService<Live> {
	
	/**
	 * 获取分页
	 * @param curPage
	 * @return
	 */
	public Page<Live> getPage(int curPage){
		return super.getPage(curPage, "select *", " from live where 1=1 order by create_date desc ");
	}
	
	/**
	 * 删除直播
	 * @param id
	 * @return
	 */
	public boolean delete(String id){
		return super.delById(id);
	}
	
	/**
	 * 添加直播
	 * @param Live
	 * @return
	 */
	public boolean add(Live live){
		return super.save(live);
	}
	
	/**
	 * 修改直播
	 * @param Live
	 * @return
	 */
	public boolean update(Live live){
		return super.update(live);
	}
	
	/**
	 * 根据id获取详细
	 * @param id
	 * @return
	 */
	public Live getLiveById(String id){
		return super.findById(id);
	}
	
}
